package com.cvte.shop.service.impl;

import com.cvte.shop.entity.UniversalDefinedCondition;
import com.cvte.shop.service.UniversalDefinedConditionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.cvte.csb.jdbc.mybatis.biz.BaseBiz;
import com.cvte.shop.mapper.UniversalDefinedConditionMapper;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 服务实现类
 *
 * @author inv
 * @since 2020-08-04
 */
@Service
@Transactional
public class UniversalDefinedConditionServiceImpl extends BaseBiz<UniversalDefinedConditionMapper, UniversalDefinedCondition> implements UniversalDefinedConditionService {

    @Autowired
    private UniversalDefinedConditionMapper universalDefinedConditionMapper;

    @Override
    public void addCondition(List<UniversalDefinedCondition> conditionList,String viewId,String tableId) {
        for (UniversalDefinedCondition universalDefinedCondition : conditionList) {
            universalDefinedCondition.setViewId(viewId);
            universalDefinedCondition.setTableId(tableId);
            universalDefinedConditionMapper.insert(universalDefinedCondition);
        }
    }
}
